package com.logo.egitim.crm.service;

import java.io.Serializable;
import java.util.List;

import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

import com.logo.egitim.crm.dao.GenericDao;


public abstract class GenericService<E> implements Serializable{
	
	public abstract GenericDao<E> getDao();

	@TransactionAttribute(TransactionAttributeType.REQUIRED)
	public boolean kaydet(E nesne){
		getDao().kaydet(nesne);
		return true;
	}
	
	@TransactionAttribute(TransactionAttributeType.REQUIRED)
	public boolean sil(E nesne){
		getDao().sil(nesne);
		return true;
	}
	
	@TransactionAttribute(TransactionAttributeType.REQUIRED)
	public boolean duzenle(E nesne){
		getDao().duzenle(nesne);
		return true;
	}

	public List<E> listeGetir() {
		return getDao().liste();
	}
}
